/*
 * @Author: likang xie
 * @Date: 2020-11-12 17:05:44
 * @Purpose: 工具类
 */

// 点击反馈
.u-pointer {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    filter: brightness(0.8);
  }
}

.u-pointer-bcl {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    background-color: $u-bg-color !important;
  }
}

// 文字
.u-font-light {
  font-weight: 200;
}

.u-font-bold {
  font-weight: bold;
}

.u-font-underline {
  text-decoration: underline;
}

.u-font-deleteline {
  text-decoration: line-through;
}

.u-lh-1 {
  line-height: 1;
}

.u-lh-2 {
  line-height: 2;
}

@for $i from 5 through 40 {
  .u-fz-#{$i} {
    font-size: $i * 2rpx;
  }
}

@for $i from 1 to 5 {
  .u-line-#{$i} {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: $i;
    overflow: hidden;
    white-space: unset;
    text-overflow: unset;
  }
}

// 对齐
.u-vt-top {
  vertical-align: top;
}

.u-vt-middle {
  vertical-align: middle;
}

.u-vt-bottom {
  vertical-align: bottom;
}

.u-text-left {
  text-align: left;
}

.u-text-center {
  text-align: center;
}

.u-text-right {
  text-align: right;
}

.u-text-between {
  text-align: justify;
  text-align-last: justify;
}

// 圆角
.u-radius {
  border-radius: 12rpx;
  overflow: hidden;
}

.u-radius-lg {
  border-radius: 30rpx;
  overflow: hidden;
}

.u-radius-top {
  border-top-left-radius: 30rpx;
  border-top-right-radius: 30rpx;
}

// 边距
@for $i from 0 through 20 {
  @each $word, $key in "t" "top", "r" "right", "b" "bottom", "l" "left", "" {
    @if ($key) {
      .u-m#{$word}-#{$i * 5} {
        margin-#{$key}: $i * 5 * 2rpx !important;
      }

      .u-p#{$word}-#{$i * 5} {
        padding-#{$key}: $i * 5 * 2rpx !important;
      }
    } @else {
      .u-m#{$word}-#{$i * 5} {
        margin: $i * 5 * 2rpx !important;
      }

      .u-p#{$word}-#{$i * 5} {
        padding: $i * 5 * 2rpx !important;
      }
    }
  }
}

.u-pt-status {
  padding-top: var(--status-bar-height) !important;
}

.u-pt-status-box {
  padding-top: calc(var(--status-bar-height) + 20rpx) !important;
}

// 阴影
.u-shadow {
  box-shadow: 0 0 10rpx 2rpx $u-bg-color;
}

.u-shadow-top {
  box-shadow: 0 -10rpx 10rpx -10rpx $u-bg-color;
}

.u-shadow-right {
  box-shadow: 10rpx 0 10rpx -10rpx $u-bg-color;
}

.u-shadow-bottom {
  box-shadow: 0 10rpx 10rpx -10rpx $u-bg-color;
}

.u-shadow-left {
  box-shadow: -10rpx 0 10rpx -10rpx $u-bg-color;
}
